package com.heima.zuoye.day04.timu2;

import java.time.LocalDateTime;
import java.time.Year;
import java.time.format.DateTimeFormatter;

public class Time {
    public static void main(String[] args) {
        String s = "2020-12-12 12:23:12";
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("y-M-dd HH:mm:ss");
        LocalDateTime time = LocalDateTime.parse(s, dtf);
        LocalDateTime time1 = time.plusYears(1).plusMonths(2).plusDays(3).plusHours(4).plusMinutes(8).plusSeconds(45);
        DateTimeFormatter dtf1 = DateTimeFormatter.ofPattern("y年M月dd日 HH小时mm分钟ss秒");
        String format = dtf1.format(time1);
        System.out.println(format);
    }
}
